﻿namespace WPForms.Phone.View
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;

    /// <summary>
    /// REnders a number field.
    /// </summary>
    public partial class NumberField : UserControl
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="NumberField" /> class.
        /// </summary>
        public NumberField()
        {
            this.InitializeComponent();
        }

        ////void NumberField_Loaded(object sender, RoutedEventArgs e)
        ////{
        ////    var model = (WPForms.Common.Model.NumberField)this.DataContext;
        ////    if (model.Label.Contains("{0}"))
        ////    {
        ////        this.complexText.Blocks.Clear();
        ////        this.simpleGrid.Visibility = System.Windows.Visibility.Collapsed;
        ////        var split = model.Label.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
        ////        var para = new Paragraph();
        ////        para.Inlines.Add(split[0]);
        ////        var container = new InlineUIContainer();
        ////        var tb = new TextBox()
        ////        {
        ////            Height = 72,
        ////            Width = model.TextBoxWidth,
        ////            MinWidth = 72,
        ////            HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch,
        ////            VerticalAlignment = System.Windows.VerticalAlignment.Center,
        ////            InputScope = new InputScope()
        ////            {
        ////                Names = { new InputScopeName() { NameValue = InputScopeNameValue.Number } }
        ////            },
        ////        };
        ////        container.Child = tb;
        ////        tb.SetBinding(
        ////            TextBox.TextProperty,
        ////            new System.Windows.Data.Binding("Value")
        ////            {
        ////                Mode = System.Windows.Data.BindingMode.TwoWay,
        ////            });
        ////        para.Inlines.Add(container);
        ////        para.Inlines.Add(split[1]);
        ////        this.complexText.Blocks.Add(para);
        ////    }
        ////    else
        ////    {
        ////        this.complexText.Visibility = System.Windows.Visibility.Collapsed;
        ////        if (model.TextBoxWidth > 0)
        ////        {
        ////            this.simpleText.MinWidth = model.TextBoxWidth;
        ////            this.textColumn.Width = new GridLength(model.TextBoxWidth);
        ////            this.labelColumn.Width = new GridLength(1, GridUnitType.Star);
        ////        }
        ////    }
        ////}
    }
}
